﻿@model ZhongheCms.Models.GswTblBusInfo
@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var chkName = "";
    var strChk1 = "";
        
}

<div class="row">
    <div class="col-xs-12 col-sm-12 widget-container-col">
        @using (Html.BeginForm("ReserveManager", "BusInfo", new { id = Model.Id, ViewBag.m, ViewBag.f, ViewBag.p, ViewBag.fid, ViewBag.sdate, ViewBag.edate, ViewBag.keywords }, FormMethod.Post,
            new { name = "myForm", id = "myForm", @class = "form-horizontal", role = "form" }))
        {
            <div class="widget-box">
                <div class="widget-header">
                    <h5 class="widget-title">@ViewBag.f  @if (!string.IsNullOrEmpty(ViewBag.p))
                                                         {
                        <span>(@ViewBag.p)</span>
                                                         }</h5>

                    <div class="widget-toolbar">
                    </div>
                </div>

                <div class="widget-body">


                    <div class="widget-main">

                        <div class="form-group">
                            <table id="sample-table-1" class="table table-bordered table-hover">
                                <tbody>
                                    <tr>
                                        <td class="align-right" style="width: 15%; background: #f6f6f6">发车日期
                                        </td>
                                        <td>

                                            @Model.StartDate.ToShortDateString() <span>&nbsp;&nbsp;</span>@Model.StartTime

                                        </td>
                                        <td class="align-right" style="width: 15%; background: #f6f6f6">出发地点
                                        </td>
                                        <td>

                                            @Model.OriginPlace

                                        </td>

                                    </tr>


                                    <tr>
                                        <td class="align-right" style="width: 15%; background: #f6f6f6">目的地
                                        </td>
                                        <td>

                                            @Model.EndPlace

                                        </td>
                                        <td class="align-right" style="width: 15%; background: #f6f6f6">途径
                                        </td>
                                        <td >
                                            @Model.RouteLine
                                        </td>
                                    </tr>

                                    <tr>
                                        <td class="align-right" style="width: 15%; background: #f6f6f6">座位数量
                                        </td>
                                        <td>

                                            @Model.Seats

                                        </td>
                                        <td class="align-right" style="width: 15%; background: #f6f6f6">报名截止
                                        </td>
                                        <td >
                                            @Model.EndDate.ToShortDateString()

                                        </td>
                                    </tr>

                                  
                                        @if (Model.BusBooks.Count > 0)
                                        {
                                              <tr>

                                            <td colspan="4">
                                                <table class="table table-bordered table-hover">
                                                    <thead>
                                                        <tr>
                                                            <th class="center">取消
                                                            </th>
                                                             <th>报名日期
                                                            </th>
                                                           
                                                            <th>会员姓名
                                                            </th>

                                                            <th>
                                                                联系电话
                                                            </th>
                                                            <th>
                                                                QQ
                                                            </th>
                                                            <th>
                                                                电子邮件
                                                            </th>
                                                           @* <th>
                                                                预订座位
                                                            </th>*@
                                                            <th>
                                                                确认日期
                                                            </th>
                                                             <th class="center">确认
                                                            </th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                        @foreach (var item in Model.BusBooks)
                                                        {
                                                            chkName = "chk" + item.Id;
                                                            strChk1 = "";
                                                           
                                                            <tr>
                                                                <td class="center">
                                         @if (item.ConfirmFlag > 0)
                                    {
                                        <a  class="confirm" href="/BusInfo/ReserveDelete/@Model.Id?rid=@item.Id&m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid&sdate=@ViewBag.sdate&edate=@ViewBag.edate&keywords=@ViewBag.keywords"><span
                                                                                                                                                                                                                       class="btn btn-xs btn-danger no-border"><i class="fa fa-trash-o"></i></span></a>
                                    }
                                       
                                    </td>
                                                                <td>
                                                                    @item.BookDate.ToShortDateString() <span>&nbsp;</span>@item.BookTime

                                                                </td>
                                                                
                                                                <td>
                                                                    @item.MemberName
                                                                </td>
                                                                <td>
                                                                    @item.MemberTel
                                                                </td>
                                                                <td>
                                                                    @item.MemberQQ
                                                                </td>
                                                              
                                                                <td>
                                                                    @item.MemberEmail
                                                                </td>
                                                                @*<td>
                                                                    @item.BookNum
                                                                </td>*@
                                                                <td>
                                                                    @if (item.ConfirmFlag > 0)
                                                                    {
                                                                        @item.BookDate
                                                                    }
                                                                </td>
                                                                <td class="center">
                                                                    @if (item.ConfirmFlag == 0)
                                                                    {
                                                                        <input type="checkbox" id="@chkName" name="@chkName" value="@item.Id" />
                                                                    }
                                                                    
                                                                </td>
                                                            </tr>
                                       
                                                        }
                                                    </tbody>
                                                </table>

                                            </td>
                                        </tr>
                                        }

                                    

                                </tbody>
                            </table>
                        </div>


                        @if (ViewBag.scode == "1")
                        {
                            <div class="hr hr-2 dotted"></div>
                            <div class="alert alert-success">
                                <button type="button" class="close" data-dismiss="alert">
                                    <i class="icon-remove"></i>
                                </button>

                                <strong>
                                    <i class="icon-ok"></i>
                                    提示信息
                                </strong>

                                信息保存成功!
																
                            </div>
                        }
                        @if (ViewBag.scode == "0")
                        {
                            <div class="hr hr-2 dotted"></div>
                            <div class="alert alert-danger">
                                <button type="button" class="close" data-dismiss="alert">
                                    <i class="icon-remove"></i>
                                </button>

                                <strong>
                                    <i class="icon-remove"></i>
                                    错误提示
                                </strong>

                                @Html.ValidationSummary(true)

                            </div>

                        }
                        <div class="clearfix form-actions">
                            <div class="col-md-offset-3 col-md-9">
                                <button class="btn btn-info" type="submit">
                                    &nbsp;&nbsp;<i class="ace-icon fa fa-check bigger-110"></i>
                                    保存&nbsp;&nbsp;
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="button" onclick="funBack()">
                                    &nbsp;&nbsp;<i class="ace-icon fa fa-undo bigger-110"></i>
                                    返回&nbsp;&nbsp;
                                </button>
                            </div>
                        </div>




                    </div>



                </div>

            </div>
        }

    </div>


</div>
@section js{
    <script src="/assets/js/jquery.validate.min.js"></script>
    <script src="/assets/js/jquery.validate.unobtrusive.js"></script>
    <script src="/assets/js/jquery.validate.unobtrusive.bootstrap.js"></script>
    
    <script type="text/javascript">
      
         function funBack() {
             document.location = "/BusInfo/Reserve/0?m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid&sdate=@ViewBag.sdate&edate=@ViewBag.edate&keywords=@ViewBag.keywords";
        }
    </script>
}
